package com.neu.service.impl;

import com.neu.mapper.MaterialMapper;
import com.neu.pojo.Material;
import com.neu.service.MaterialService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MaterialServiceImpl implements MaterialService {

    @Resource
    MaterialMapper materialMapper;

    @Override
    public int insertMaterial(Material material) {
        return materialMapper.insertMaterial(material);
    }

    @Override
    public int updateMaterial(Material material) {
        return materialMapper.updateMaterial(material);
    }

    @Override
    public int deleteMaterialGroup(int pid, int type) {
        return materialMapper.deleteMaterialGroup(pid,type);
    }

    @Override
    public int deleteMaterial(int id) {
        return materialMapper.deleteMaterial(id);
    }

    @Override
    public List<Material> list(int pid, int type) {
        return materialMapper.queryMaterialList(pid, type);
    }
}
